module.exports = {
	callApi: function(apiURL, paramObj, windowContextCallBackName) { //网络访问
		console.log(paramObj)
		
		//paramObj = JSON.stringify(paramObj);
		frameScript.ajax({
			url: this.API_SERVER + apiURL,
			method: "POST",
			data: paramObj,
			//请求成功返回当前状态码和状态信息以及结果
			success: function(data) {				
				if(typeof windowContextCallBackName == "function") {
					windowContextCallBackName(data);
				}
			},

			//请求失败返回当前失败状态码和状态信息
			error: function(err) {
				
				alert(err.message)
				console.log("接口访问失败");
			}
		});
	},
	callProductApi: function(apiURL, paramObj, windowContextCallBackName) { //网络访问
		console.log(paramObj)
		
		//paramObj = JSON.stringify(paramObj);
		frameScript.ajax({
			url: this.API_SERVER_PRODUCT + apiURL,
			method: paramObj.type? paramObj.type:"POST",
			data: paramObj,
			//请求成功返回当前状态码和状态信息以及结果
			success: function(data) {				
				if(typeof windowContextCallBackName == "function") {
					windowContextCallBackName(data);
				}
			},

			//请求失败返回当前失败状态码和状态信息
			error: function(err) {
				
				alert(err.message)
				console.log("接口访问失败");
			}
		});
	},
	callVinApi: function(apiURL, paramObj, windowContextCallBackName) { //网络访问
		console.log(paramObj)
		
		//paramObj = JSON.stringify(paramObj);
		frameScript.ajax({
			url: this.API_VIN + apiURL,
			method: "POST",
			data: paramObj,
			//请求成功返回当前状态码和状态信息以及结果
			success: function(data) {				
				if(typeof windowContextCallBackName == "function") {
					windowContextCallBackName(data);
				}
			},

			//请求失败返回当前失败状态码和状态信息
			error: function(err) {
				
				alert(err.message)
				console.log("接口访问失败");
			}
		});
	}
}